package com.golte.dataform.analysis.vo.response;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("会员级别")
public class UserLevelDistribution {
    //    @ApiModelProperty(value = "会员级别分布、身份")
//    private String fen_bu;
//    @ApiModelProperty(value = "会员级别分布数量")
//    private Integer register_user_cnt_sum;
//    @ApiModelProperty(value = "会员级别分布数量占比")
//    private Double register_cnt_rate;
    @ApiModelProperty(value = "会员级别分布")
    private String userLevel;
    @ApiModelProperty(value = "会员级别分布、身份")
    private String fenBu;
    @ApiModelProperty(value = "会员级别分布数量")
    private Integer registerUserCntSum;
    @ApiModelProperty(value = "会员级别分布数量占比")
    private Double registerCntRate;
    private List<UserLevelDistribution> childs;

    public Double getRegisterCntRate() {
        BigDecimal b = BigDecimal.valueOf(registerCntRate);
        return b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    public void setRegisterCntRate(Double registerCntRate) {
        this.registerCntRate = registerCntRate;
    }
}
